package com.fjec.market.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 012.商品sku表
 * </p>
 *
 * @author admin
 * @since 2020-09-10
 */
@TableName(value = "info_sku", autoResultMap = true)
@Data
public class InfoSku implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键Id
     */
    @TableId("Id")
    private Long id;

    /**
     * 市场编号
     */
//    @TableField("MarkCode")
//    private Integer markCode;

    /**
     * 商户类型  2=果农
                3=分拣厂
                4=农资厂
                5=包装物厂
     */
    @TableField("BusiType")
    private Integer busiType;

    /**
     * 商户Id
     */
    @TableField("BusiId")
    private Long busiId;

    /**
     * 商品SpuId
     */
    @TableField("SpuId")
    private Long spuId;

    /**
     * 标题
     */
    @TableField("SkuTitle")
    private String skuTitle;

    /**
     * 批发报价单位
     */
    @TableField("WholesaleUnit")
    private String wholesaleUnit;

    /**
     * 批发参考报价
     */
    @TableField("WholesalePrice")
    private Integer wholesalePrice;

    /**
     * 零售包装规格
     */
    @TableField("RetailSpec")
    private String retailSpec;

    /**
     * 包邮价格 单位分
     */
    @TableField("RetailPrice")
    private Integer retailPrice;

    /**
     * 商品图片
     */
    @TableField(value = "SpuPics", typeHandler = JacksonTypeHandler.class)
    private List<String> spuPics;

    /**
     * 是否上传小视频 0=否
1=是
     */
    @TableField("HasVideo")
    private Integer hasVideo;

    /**
     * 小视频
     */
    @TableField(value = "SpuVideos", typeHandler = JacksonTypeHandler.class)
    private List<String> spuVideos;

    /**
     * 折扣状态 1=不打折
            2=定时打折
            3=永久打折
     */
    @TableField("DiscStatus")
    private Integer discStatus;

    /**
     * 折扣（默认为1）
     */
    @TableField("Discount")
    private BigDecimal discount;

    /**
     * 折扣开始时间
     */
    @TableField("DiscStartTime")
    private LocalDateTime discStartTime;

    /**
     * 折扣结束时间
     */
    @TableField("DiscEndTime")
    private LocalDateTime discEndTime;

    /**
     * 是否可以使用优惠卷
     */
    @TableField("AllowCoupon")
    private Integer allowCoupon;

    /**
     * 可用优惠卷类型
     */
    @TableField("CouponType")
    private String couponType;

    /**
     * 库存数量 -1=无限库存
     */
    @TableField("Stock")
    private Integer stock;

    /**
     * 销售数量
     */
    @TableField("SaleNum")
    private Integer saleNum;

    /**
     * 更新版本号 更新数据版本号
     */
    @TableField("UpdateVer")
    @Version
    private Integer updateVer;

    /**
     * 是否上架 0=否
1=是
     */
    @TableField("Saleable")
    private Integer saleable;

    /**
     * 是否有效 0=否
1=是
     */
    @TableField("Valid")
    private Integer valid;

    /**
     * 删除标记 0=否
1=是
     */
    @TableField("DelFlag")
    private Integer delFlag;

    /**
     * 创建时间
     */
    @TableField("CreateTime")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("UpdateTime")
    private LocalDateTime updateTime;

    @Override
    public String toString() {
        return "InfoSku{" +
            "id=" + id +
//            ", markCode=" + markCode +
            ", busiType=" + busiType +
            ", busiId=" + busiId +
            ", spuId=" + spuId +
            ", skuTitle=" + skuTitle +
            ", wholesaleUnit=" + wholesaleUnit +
            ", wholesalePrice=" + wholesalePrice +
            ", retailSpec=" + retailSpec +
            ", retailPrice=" + retailPrice +
            ", spuPics=" + spuPics +
            ", hasVideo=" + hasVideo +
            ", spuVideos=" + spuVideos +
            ", discStatus=" + discStatus +
            ", discount=" + discount +
            ", discStartTime=" + discStartTime +
            ", discEndTime=" + discEndTime +
            ", allowCoupon=" + allowCoupon +
            ", couponType=" + couponType +
            ", stock=" + stock +
            ", saleNum=" + saleNum +
            ", updateVer=" + updateVer +
            ", saleable=" + saleable +
            ", valid=" + valid +
            ", delFlag=" + delFlag +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
